package com.demo.constant;

import com.mysql.cj.jdbc.MysqlDataSource;

import javax.sql.DataSource;
import java.sql.SQLException;

/**
 * @Author: LiuYuanQi
 * @Date: 2020/4/15 11:31
 */
public class DataSourceInfo {

    public static DataSource getDataSource(){
        MysqlDataSource dataSource=new MysqlDataSource();
        try {
            dataSource.setServerName("localhost");
            dataSource.setUser("root");
            dataSource.setPassword("123");
            dataSource.setDatabaseName("test");
            dataSource.setServerTimezone("UTC");
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return dataSource;
    }

}
